import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);


export default new Vuex.Store({
  state: {
    sidebar: {
      home: false,
      watches: false,
      login: false
    }
  },
  mutations: {
    sidebar({ sidebar }, router) {
      for (let key in sidebar) {
        sidebar[key] = key === router ? true : false
      }
    }
  },
  getters: {
    sidebar(state) {
      return state.sidebar
    }
  }
})